import request from '@/utils/request'
// 获取部门列表
export function department() {
  return request({
    url: '/company/department',
    method: 'get'

  })
}
// 增加部门
export function addDepartments(data) {
  return request({
    url: '/company/department',
    method: 'post',
    data
  })
}
/**
 * @description: 获取部门详情
 * @param {*} id 表示当前要编辑项的id值
 * @return {*}
 */
export function getDepartDetail(id) {
  return request({
    url: '/company/department/' + id
  })
}
// 编辑部门数据
export function updateDepartmentById(data) {
  return request({
    method: 'put',
    url: '/company/department/' + data.id,
    data
  })
}
// 删除部门数据
/**
 * @description: 删除部门
 * @param {*} id 当前点击的操作按钮 所在的项的id
 * @return {*}
 */
export function delDepartment(id) {
  return request({
    url: `/company/department/${id}`,
    method: 'delete'
  })
}

